package co.edu.icesi.sca.server;

import java.util.Observable;
import java.util.Observer;

import org.osoa.sca.annotations.Scope;

import co.edu.icesi.sca.common.ServerInteraction;

@Scope("CONVERSATION")
public class Server extends Observable implements ServerInteraction
{
    private String message;
    
    @Override
    public synchronized void addObserver( Observer o )
    {
        super.addObserver( o );
    }

    @Override
    public void sendMessage( String msg )
    {
        message = msg;
        setChanged( );
        System.out.println(hasChanged( ));
        notifyObservers(message);
    }
}
